﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using DotNetNuke.Modules.Help.Tests.Mocks;

namespace DotNetNuke.Modules.Help.Tests
{
    /// <summary>
    /// Summary description for TestDrivenDNNModuleControllerFixture
    /// </summary>
    [TestClass]
    public class HelpTutorialControllerFixture
    {
        private DateTime createdDate = new DateTime(MockHelper.createdDateYear, MockHelper.createdDateMonth, MockHelper.createdDateDay);
        IDataProvider dataProvider;
        IHelpTutorialController helpTutorialController;

        public HelpTutorialControllerFixture()
        {
            dataProvider = new MockDataProvider();
            helpTutorialController = new HelpTutorialController(dataProvider);
        }

        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        [TestMethod]
        [Description("Add a HelpTutorialInfo with the concrete controller using a MockDataProvider")]
        [Owner("Philip Beadle")]
        public void AddHelpTutorialController()
        {
            HelpTutorialInfo helpTutorialInfo = MockHelper.CreateHelpTutorialInfo();
            //int itemId = helpTutorialController.(helpTutorialInfo);

            //Assert.AreEqual<int>(MockHelper.ValidTestDrivenDNNModuleInfoId, itemId);
        }

        [TestMethod]
        [Description("Add a TestDrivenDNNModuleInfo, no content with the concrete controller using a MockDataProvider")]
        [Owner("Philip Beadle")]
        public void AddHelpTutorialNoContentController()
        {
            HelpTutorialInfo helpTutorialInfo = MockHelper.CreateHelpTutorialInfo();
            //helpTutorialInfo.Content = string.Empty;
            //int itemId = testDrivenDNNModuleController.AddTestDrivenDNNModule(testDrivenDNNModuleInfo);

            //Assert.AreEqual<int>(DotNetNuke.Common.Utilities.Null.NullInteger, itemId);
        }

        [TestMethod]
        [Description("Update a HelpTutorialInfo with the concrete controller using a MockDataProvider")]
        [Owner("Philip Beadle")]
        public void UpdateHelpTutorialController()
        {
            HelpTutorialInfo helpTutorialInfo = MockHelper.CreateHelpTutorialInfo();
            //testDrivenDNNModuleController.UpdateTestDrivenDNNModule(testDrivenDNNModuleInfo);
        }

        [TestMethod]
        [Description("Update a HelpTutorialInfo, no content with the concrete controller using a MockDataProvider")]
        [Owner("Philip Beadle")]
        [ExpectedException(typeof(ArgumentException), "No Content")]
        public void UpdateTestDrivenDNNModuleNoContentController()
        {
            HelpTutorialInfo helpTutorialInfo = MockHelper.CreateHelpTutorialInfo();
            //helpTutorialInfo.Content = string.Empty;
            //testDrivenDNNModuleController.UpdateTestDrivenDNNModule(testDrivenDNNModuleInfo);
        }

        [TestMethod]
        [Description("Retrieves a HelpTutorialInfo from the concrete controller using a MockDataProvider")]
        [Owner("Philip Beadle")]
        public void GetTestDrivenDNNModuleController()
        {
            //TestDrivenDNNModuleInfo testDrivenDNNModuleInfo = testDrivenDNNModuleController.GetTestDrivenDNNModule(MockHelper.ModuleId, MockHelper.ValidTestDrivenDNNModuleInfoId);

            //Assert.AreEqual<string>(MockHelper.content, testDrivenDNNModuleInfo.Content);
            //Assert.AreEqual<int>(MockHelper.createdByUser, testDrivenDNNModuleInfo.CreatedByUser);
            //Assert.AreEqual<string>(MockHelper.createdByUserName, testDrivenDNNModuleInfo.CreatedByUserName);
            //Assert.AreEqual<DateTime>(createdDate, testDrivenDNNModuleInfo.CreatedDate);
        }

        //[TestMethod]
        //[Description("Retrieves HelpTutorialInfo from the concrete controller using a MockDataProvider")]
        //[Owner("Philip Beadle")]
        //public void GetTestDrivenDNNModulesController()
        //{
        //    List<TestDrivenDNNModuleInfo> testDrivenDNNModuleInfos = testDrivenDNNModuleController.GetTestDrivenDNNModules(MockHelper.ModuleId);

        //    Assert.AreEqual<int>(2, testDrivenDNNModuleInfos.Count);
        //}

        //[TestMethod]
        //[Description("Deletes a HelpTutorialInfo with the concrete controller using a MockDataProvider")]
        //[Owner("Philip Beadle")]
        //public void DeleteTestDrivenDNNModuleController()
        //{
        //    testDrivenDNNModuleController.DeleteTestDrivenDNNModule(MockHelper.ModuleId, MockHelper.ValidTestDrivenDNNModuleInfoId);
        //}
    }


}
